<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
	<head>
		<meta http-equiv="Content-Type" content="application/xhtml+xml; charset=UTF-8" />
		<script type="text/javascript" src="js/jquery-1.2.6.js"></script>
		<script type="text/javascript" src="js/chinese.js"></script>
		<link type="text/css" rel="stylesheet" href="style/style.css" />
		<title></title>
</head>
<body class="gui">

<div id="wrapper">
<div id="content">
	<div id="header">
<div id="logo">
<h1>Control Panel</h1>
</div>
<div id="mainMenu">
	<span><a id="nets" href="wan.htm"><img id="net" src="images/net_small.png" border="0"></a></span>
	<span><a id="cdrs" href="Dialing.htm"><img id="cdr" src="images/cdr_big.png" border="0"></a></span>
	<span><a id="manages" href="downlog.htm"><img id="manage" src="images/manage_small.png" border="0"></a></span>
</div>
<div id="menu">
 <div id="menuMain">
  <ul id="menuMainList">
  	<li><a href="Dialing.htm"><strong><script type="text/javascript">Capture(ivr_menu.basic)</script></strong></a></li>
   	<li><a href="extension.htm"><strong><script type="text/javascript">Capture(ivr_menu.extension_config)</script></strong></a></li>
   	<li class="current"><span><strong><script type="text/javascript">Capture(ivr_menu.trunk_config)</script></strong></span>
   		<div id="menuSub">
     		<ul id="menuSubList">
     			<li id="lineshow"><a href="trunk.htm"><strong><script type="text/javascript">Capture(ivr_menu.trunk)</script></strong></a></li>
      		<li><a href="ip_trunk.htm"><span><strong><script type="text/javascript">Capture(ivr_menu.ip_trunk)</script></strong></span></a></li>
      		<li><a href="ip_trunk_reg.htm"><strong><script type="text/javascript">Capture(ivr_menu.trunk_reg)</script></strong></a></li>
     		</ul>
    	</div>
   		</li>
   	<!--<li><a href="tietrunk.htm"><strong><script type="text/javascript">Capture(ivr_menu.tietrunk)</script></strong></a></li>-->
   	<li><a href="Analog_trunk.htm"><strong><script type="text/javascript">Capture(ivr_menu.system)</script></strong></a></li>
   	<li><a href="Systemcfg.htm"><strong><script type="text/javascript">Capture(ivr_menu.advanced)</script></strong></a></li>
  </ul>
 </div>
</div>
</div>
<div id="main">
<div id="contents_stat">
<form name="filters" action="#" method="post" >
<fieldset>
<legend><script type="text/javascript">Capture(trunk.stat_ip)</script></legend>
<div class="frame_tab_layer">
<table width="100%" border="0" cellpadding="0" cellspacing="0" class="cmenutitle" id="iptrunk_stat">
</table>
</div>
</fieldset>
</form>
</div>
</div>

<div id="floatKiller"></div>
<div id="statusInfo">

<div class="info"><span id="loginuser"></span></div>
<!--<div class="info"><script type="text/javascript">Capture(share.logintime)</script><span id="uptime"></span></div>-->
<div class="info"><button class="logout" onclick="reboot();"><img src="images/reboot.gif" border="0">&#160;<script type="text/javascript">Capture(tools.td10)</script></button><button class="logout" onclick="logout();"><img src="images/logout.gif" border="0">&#160;<script type="text/javascript">Capture(share.logout)</script></button></div>
</div>

</div>
</div>
<div id="lock_div">&nbsp; </div>
<div id="lock_div2">&nbsp;</div>
<div id="message_panel"><span id="mess">&nbsp;</span><br/>
  <br/>
  <img src="images/jd.gif"/>
</div><script type="text/javascript">
	setTimeout("height_div()",500);
	ivr_load();
		</script>
<script type="text/javascript" src="lib.js"></script>
<script type="text/javascript" src="js/message_panel.js"></script>
<script type="text/javascript" src="js/libTable.js"></script>
<script type="text/javascript">
	if(lineshow("4001")){
	var groupid="&id=4021";
	xmlDataRequest("get_data",groupid,function(data){
			var sendtext = ''; var flag=0;
  			$(data).find("value").each(function(){
  				if($.trim($(this).text().split("/")[2])!==""){
  					sendtext += "&line_id="+$.trim($(this).text().split("/")[1]);
  					flag++;
  				}
  			});
  			if(sendtext!==""){
			DataRequest("get_json",sendtext,function(data){
				virtual_paint_list(data,flag);
			});
		}
});
}
function virtual_paint_list(data,flag){
	if(flag!==0&&flag!==1){
 var data_new=new Array();
 var j=0;
  for(var i=0;i<data.length;i++){
  var line_id = data[i].line_id;
  var id401 = replacestr(data[i].id401);
   if(data[i].id457=="on"){
  		var id457=sip_trunk.table3_td4_option2;
  	}else{
  		var id457=sip_trunk.table3_td4_option1;
  	}
  		if(data[i].id469!=""){
  		if(data[i].id447=="on"){
  			var id447=trunk.outbound_option3;
  		}else{
  			var id447=trunk.outbound_option4;
  		}
	}else{
		if(data[i].id447=="on"){
  			var id447=trunk.outbound_option2;
  		}else{
  			var id447=trunk.outbound_option1;
  		}
	}
  var id654 = replacestr(data[i].id654);
  var id433 = replacestr(data[i].id433);
  var id432 = replacestr(data[i].id432);
  var id469 = replacestr(data[i].id469);
  var id468 = replacestr( data[i].id468);
  var id594 = replacestr(data[i].id594);
  var id571 = replacestr(data[i].id571);
  var id573= replacestr(data[i].id573);
  data_new.push({line_id:line_id,id401:id401,id457:id457,id654:id654,id433:id433,id432:id432,id469:id469,id447:id447,id468:id468,id594:id594,id571:id571,id573:id573});
  j = i;
 }
 //var fun_arr = [{type:"modify",name:"virtual_change"},{type:"del",name:"virtual_del"}];
 var fun_arr = {type:"",name:""};
 var tab = new libTable(new Array(trunk.ID,trunk.phonenumber,trunk.enable,trunk.concurrent,trunk.registration,trunk.password,trunk.DID,trunk.outbound,trunk.greeting,trunk.recording,trunk.server,trunk.sub_domain),data_new,1,10);
 print_table("iptrunk_stat",tab,fun_arr, true);
}else{
	 var data_new=new Array();
  var line_id = data.line_id;
  var id401 = replacestr(data.id401);
   if(data.id457=="on"){
  		var id457=sip_trunk.table3_td4_option2;
  	}else{
  		var id457=sip_trunk.table3_td4_option1;
  	}
  var id654 = replacestr(data.id654);
  var id433 = replacestr(data.id433);
  var id432 = replacestr(data.id432);
  var id469 = replacestr(data.id469);
  //var id447 = replacestr(data.id447);
    	if(data.id469!=""){
  		if(data.id447=="on"){
  			var id447=trunk.outbound_option3;
  		}else{
  			var id447=trunk.outbound_option4;
  		}
	}else{
		if(data.id447=="on"){
  			var id447=trunk.outbound_option2;
  		}else{
  			var id447=trunk.outbound_option1;
  		}
	}
  var id468 = replacestr( data.id468);
  var id594 = replacestr(data.id594);
  var id571 = replacestr(data.id571);
  var id573= replacestr(data.id573);
  data_new.push({line_id:line_id,id401:id401,id457:id457,id654:id654,id433:id433,id432:id432,id469:id469,id447:id447,id468:id468,id594:id594,id571:id571,id573:id573});
 var fun_arr = {type:"",name:""};
 var tab = new libTable(new Array(trunk.ID,trunk.phonenumber,trunk.enable,trunk.concurrent,trunk.registration,trunk.password,trunk.DID,trunk.outbound,trunk.greeting,trunk.recording,trunk.server,trunk.sub_domain),data_new,1,10);
 print_table("iptrunk_stat",tab,fun_arr, true);
}
}
</script>
</body>
</html>
